<% get_restaurant_navbar('restaurant') %>
<div class="page">
  <div class="page-container">
    <div class="container">
      <div class="row">
       <div class="span12">
  <h4 class="header"><%=  "所有店铺二维码图" %></h4>
  <table id="datatables" class="table table-bordered table-striped responsive">
    <thead>
    <tr>
      <th>缩率图</th>
      <th>桌号</th>
    </tr>
    </thead>
    <tbody>
    <% 1.upto(@restaurant.total_tables).each do |item| %>
        <tr>
          <td class="qrcode" data-url="<%= "#{HOST}/mobile/weixin/welcome/#{@restaurant.id}/#{item}" %>">
            
          </td>
          <td><%= item %></td>
        </tr>
    <% end %>
    </tbody>
  </table>
</div>
      </div>
    </div>
  </div>
</div>

<script>
  $(function(){

    $(".qrcode").each(function(){
       var url = $(this).data('url');
       $(this).qrcode(url)
    })
  })
</script>
